package com.yuexun.dhdoctor.module.email.model.impl;


import com.yuexun.dhdoctor.module.email.api.MailMainApi;
import com.yuexun.dhdoctor.module.email.bean.MailMainData;
import com.yuexun.dhdoctor.module.email.model.IMailMainModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/9/1.
 */
public class MailMainModel implements IMailMainModel {
    private MailMainApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public MailMainApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(MailMainApi.class);
        }
    }
    @Override
    public Observable<MailMainData> getUnreadData(Map<String, String> praise) {
       api = ApiInstance();
        return api.unreadMail(praise);
    }
}
